package com.qk.management.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qk.entity.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author kaoM1Jy
 * @date 2025/10/9 15:56
 * @description:
 */
@Mapper

public interface CourseMapper extends BaseMapper<Course> {
    @Select("select * from course where subject=#{subject}")
    List<Course> getBySubject(Integer subject);

    @Select("select * from course")
    List<Course> selectAll();

    void update1(Course course);

    @Delete("delete from course where id=#{id}")
    void deleteByID(Integer id);

    @Select("select * from course where id=#{id}")
    Course getById(Integer id);

    @Insert("insert into course(name, subject, target, price,description,create_time, update_time) values(#{name}, #{subject}, #{target}, #{price}, #{description},#{createTime}, #{updateTime})")
    void insertCourse(Course course);

    Integer count(String name, Integer subject, Integer target);

    List<Course> select(String name, Integer subject, Integer target, Integer offset, Integer pageSize);





}
